-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More thorough testing of BTreeMap::range #67758
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/liballoc/collections/btree/map.rs line 1955 is currently the start of loop of the |
e091010
to
8314b7f
Compare
It was bound to happen... I had another look and added a test case to cover everything. Note I also let |
|
||
#[test] | ||
fn test_range_large() { | ||
let size = 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try running this in Miri? I think it'll be too slow, and it's probably best to disable this test in Miri (or maybe use a smaller size in Miri, one that doesn't take forever).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I always ask Miri. In fact I was relying on Miri a bit too much lately.
It's not a new test, but renamed from _internal _inclusive, and it was bigger before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, seems like Miri is fast enough then, great. :)
In fact I was relying on Miri a bit too much lately.
How that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, not Miri itself, actually. Just the fact that I have Miri set up to run only the src/liballoc tests and forget all the rest on Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, seems like Miri is fast enough then, great. :)
It was dragging through the test at 500, but I really don't see the point in testing something with 500 elements when 144 would give you the same 3-level search. More? Why - to have a filled up node somewhere? Then 150 would be enough. For starters, I wish we could check a tree's height and/or read that node.CAPACITY or node.B value.
@bors r+ Seems fine to add more tests to BTreeMap, since this essentially just checks current behavior rather than changing it. |
📌 Commit 8314b7f has been approved by |
More thorough testing of BTreeMap::range Test more of the paths in the `range_search` function in map.rs
☀️ Test successful - checks-azure |
Test more of the paths in the
range_search
function in map.rs